package name.jiaosha.air.iostorage.controller;

import java.util.ArrayList;
import java.util.List;

import name.jiaosha.air.AppConstants;
import name.jiaosha.air.iostorage.domain.Sale;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 出库记录
 * 
 * @author xu
 * 
 */
@Controller
@RequestMapping("/admin/strorage")
public class OutRecordController {

	@RequestMapping("/outRecord")
	public ModelAndView FindRecord() {

		List<Sale> list = null;
		int total = 0;

		if (AppConstants.DEBUG) {
			list = new ArrayList<Sale>();
			for (int i = 0; i < 10; i++) {
				Sale sale = new Sale();
				sale.setDocID("2010091000"+i);
				sale.setCreateMan("黄总"+i);
				sale.setHandler("张学友"+i);
				list.add(sale);
			}
			total = list.size();

		} else {

		}

		ModelMap model = new ModelMap();
		model.addAttribute("root", list);
		model.addAttribute("totalProperty", total);
		return new ModelAndView("jsonView", model);
	}

}
